import { HttpClient} from '@angular/common/http';
import { Component } from '@angular/core';
import {NgForOf} from '@angular/common';

@Component({
  selector: 'post',
  imports: [
    NgForOf
  ],
  templateUrl: './post.html',
  styleUrl: './post.css'
})
export class Post {
  // @ts-ignore
  posts;
  constructor(private http:HttpClient) {
    http.get('https://jsonplaceholder.typicode.com/posts')
      .subscribe(response=>{
        this.posts= response;
      })
  }


}
